package com.example.cofeed.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.cofeed.R;
import com.example.cofeed.entity.Push;

import java.util.List;

public class PushSettingAdapter extends BaseQuickAdapter<Push, BaseViewHolder> {
    public PushSettingAdapter() {
        super(R.layout.adapter_push_setting);
    }

    @Override
    protected void convert(BaseViewHolder helper, Push item) {
        if (item.ispush == 0){
            helper.setImageResource(R.id.push_switch, R.mipmap.closebutn);
        } else{
            helper.setImageResource(R.id.push_switch, R.mipmap.openbutn);
        }

        helper.setText(R.id.name_tv, item.name);

    }
}
